{template 'common/header'}
<style type="text/css">
	form {
		margin:0 auto;
	}
</style>
<div >
	<form action="" method="post" class="form-horizontal" role="form" >
		<div class="list-group">
			<p  class="list-group-item " style="background-color: #D9EDF7;width:80%;margin:0 auto">请使用：阿里云视频点播功能，请开通阿里云视频点播功能</p>
			<div active="list-group-item" style="border:1px solid #cecece;width:80%;margin:0 auto">
				<div class="form-group" style="margin-top:25px">
					<label  class="col-sm-2 control-label">regionId(区域)</label>
					<div class="col-sm-10">
						<input type="text" name="regionId" value="{$settings['regionId']}" placeholder="请填写cn-shanghai"  class="form-control" style="width:98%"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">AccessKeyID</label>
					<div class="col-sm-10">
						<input type="text" name="AccessKeyID" value="{$settings[AccessKeyID]}" placeholder="请填写Access Key ID" class="form-control" style="width:98%"/>
					</div>
				</div>
				<div class="form-group">
					<label  class="col-sm-2 control-label">AccessKeySecret</label>
					<div class="col-sm-10">
						<input type="text" name="AccessKeySecret" value="{$settings[AccessKeySecret]}"  placeholder="请填写Access Key Secret" class="form-control" style="width:98%"/>
					</div>
				</div>
			</div>

			<p  class="list-group-item " style="background-color: #D9EDF7;width:80%;margin:0 auto">请使用：阿里大鱼短信平台；此信息关系到用户短信验证码接收，请谨慎填写</p>
			<div active="list-group-item" style="border:1px solid #cecece;width:80%;margin:0 auto">
				<div class="form-group" style="margin-top:25px">
					<label class="col-sm-2 control-label">accessKeyId</label>
					<div class="col-sm-10">
						<input type="text" name="accessKeyId" value="{$settings['accessKeyId']}"  placeholder="请填写阿里大鱼accessKeyId"  class="form-control" style="width:98%"/>
					</div>
				</div>
				<div class="form-group" style="margin-top:25px">
					<label  class="col-sm-2 control-label">accessKeySecret</label>
					<div class="col-sm-10">
						<input type="text" name="accessKeySecret" value="{$settings['accessKeySecret']}"  placeholder="请填写accessKeySecret"  class="form-control" style="width:98%"/>
					</div>
				</div>
				<div class="form-group" style="margin-top:25px">
					<label  class="col-sm-2 control-label">SignName</label>
					<div class="col-sm-10">
						<input type="text" name="SignName" value="{$settings['SignName']}"  placeholder="请填写SignName"  class="form-control" style="width:98%"/>
					</div>
				</div>
				<div class="form-group" style="margin-top:25px">
					<label  class="col-sm-2 control-label">TemplateCode</label>
					<div class="col-sm-10">
						<input type="text" name="TemplateCode" value="{$settings['TemplateCode']}"  placeholder="请填写TemplateCode"  class="form-control" style="width:98%"/>
					</div>
				</div>
			</div>
<!-- 听课券机制 -->
			<p  class="list-group-item" style="background-color: #D9EDF7;width:80%;margin:0 auto">用户听课券机制<span style="color:red">默认为关闭状态，若有需要请开启,开启后默认发放数量最小为1</span></p>
			<div active="list-group-item" style="border:1px solid #cecece;width:80%;margin:0 auto">
				<div class="form-group" style="margin-top:25px;">
					<label class="col-sm-2 control-label">单张听课券价格</label>
					<div class="col-sm-10">
						<input type="text" name="cardprice" value="{if empty($settings['cardprice'])}0.00{else}{$settings['cardprice']}{/if}" class="form-control" style="width:98%" onfocus="this.value=''" onblur= "if( ! /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.value) || Number(this.value)>=50000 || this.value < $('#pay_money').val()) {alert('价格输入错误');this.value='0.00';}"/>
					</div>
				</div>
				<div class="form-group " style="margin-top: 25px">
					<label  class="col-sm-2 control-label">注册奖励设置</label>
					<div class=" col-sm-10" style="padding-left:25px">
						<label class="radio-inline">
							<input type="radio" name="nstatus" onclick="$('.new_card').show()" value="1" title="发放" {if $settings['nstatus'] == '1'}checked="checked"{/if} > 发放
						</label>
						<label class="checkbox-inline">
							<input type="radio" name="nstatus" onclick="$('.new_card').hide()" value="0" title="不发放" {if $settings['nstatus'] == '0' || empty($settings['nstatus'])}checked="checked"{/if} > 不发放
						</label>
					</div>
					<span style='color: #cecece;font-size: 14px;margin-left: 244px'>开启后新用户登录将会获得指定数量的听课券</span>
				</div>
				<div class="form-group new_card" style="margin-top:25px;{if $settings['nstatus'] == 0}display:none{/if}">
					<label class="col-sm-2 control-label">奖励数量</label>
					<div class="col-sm-10">
						<input type="number" name="nnum" value="{if empty($settings['nnum'])}1{else}{$settings['nnum']}{/if}" min="1"  class="form-control" style="width:98%" />
						<span style='color: #cecece;font-size: 14px;'>新注册用户在首次登陆后可获得的听课券奖励</span>
					</div>
				</div>

				<div class="form-group " style="margin-top: 25px">
					<label  class="col-sm-2 control-label">签到设置</label>
					<div class=" col-sm-10" style="padding-left:25px">
						<label class="radio-inline">
							<input type="radio" name="lstatus" onclick="$('.login_card').show()" value="1" title="可领取" {if $settings['lstatus'] == '1'}checked{/if} > 可领取
						</label>
						<label class="checkbox-inline">
							<input type="radio" name="lstatus" onclick="$('.login_card').hide()" value="0" title="不发放" {if $settings['lstatus'] == '0' || empty($settings['lstatus'])}checked{/if} > 不可领取
						</label>
					</div>
						<span style='color: #cecece;font-size: 14px;margin-left: 244px'>开启后用户签到可获得指定数量的听课券</span>
				</div>
				<div class="form-group login_card" style="margin-top:25px;{if $settings['lstatus'] == 0}display:none{/if}">
					<label  class="col-sm-2 control-label">签到奖励/每日</label>
					<div class="col-sm-10">
						<input type="number" name="lnum" value="{if empty($settings['lnum'])}1{else}{$settings['lnum']}{/if}" min="1"   class="form-control" style="width:98%"/>
						<span style='color: #cecece;font-size: 14px;'>用户每日签到获得听课券张数</span>
					</div>
				</div>

				<div class="form-group login_card" style="margin-top:25px;{if $settings['lstatus'] == 0}display:none{/if}">
					<label  class="col-sm-2 control-label">连续签到/每月</label>
					<div class="col-sm-10">
						<input type="number" name="lday" value="{if empty($settings['lday'])}30{else}{$settings['lday']}{/if}" min="1"   class="form-control" style="width:98%" placeholder="单位为天" />
						<span style='color: #cecece;font-size: 14px;'>默认为连续签到30天可获取1张听课券奖励</span>
					</div>
				</div>
				<div class="form-group login_card" style="margin-top:25px;{if $settings['lstatus'] == 0}display:none{/if}">
					<label  class="col-sm-2 control-label">连续签到奖励/每月</label>
					<div class="col-sm-10">
						<input type="number" name="ldnum" value="{if empty($settings['ldnum'])}1{else}{$settings['ldnum']}{/if}" min="1"   class="form-control" style="width:98%" placeholder="单位为张" />
						<span style='color: #cecece;font-size: 14px;'>用户达到连续签到天数后可获得听课券张数</span>
					</div>
				</div>


				<div class="form-group " style="margin-top: 25px">
					<label  class="col-sm-2 control-label">分享设置</label>
					<div class=" col-sm-10" style="padding-left:25px">
						<label class="radio-inline">
							<input type="radio" name="sstatus" value="1" onclick="$('.shar_card,.shar_card_num').show()" title="开启" {if $settings['sstatus'] == '1'}checked{/if} > 开启
						</label>
						<label class="checkbox-inline">
							<input type="radio" name="sstatus" value="0" onclick="$('.shar_card,.shar_card_num').hide()" title="关闭" {if $settings['sstatus'] == '0' || empty($settings['sstatus'])}checked{/if} > 关闭
						</label>
					</div>
					<span style='color: #cecece;font-size: 14px;margin-left: 244px'>开启分享机制后用户可通过分享获得听课券，默认开启</span>
				</div>
				<div class="form-group shar_card" style="margin-top:25px;{if $settings['sstatus'] == 0}display:none{/if}">
					<label  class="col-sm-2 control-label">分享次数/每日</label>
					<div class="col-sm-10">
						<input type="number" name="snumber" value="{if empty($settings['snumber'])}1{else}{$settings['snumber']}{/if}" min="1" class="form-control" style="width:98%"/>
					<span style='color: #cecece;font-size: 14px;'>分享次数上限后将不再获得听课券</span>
					</div>
				</div>

				<div class="form-group shar_card_num" style="margin-top:25px;{if $settings['sstatus'] == 0}display:none{/if}">
					<label  class="col-sm-2 control-label">分享奖励/每日</label>
					<div class="col-sm-10">
						<input type="number" name="snum" value="{if empty($settings['snum'])}1{else}{$settings['snum']}{/if}" min="1"   class="form-control" style="width:98%"/>
						<span style='color: #cecece;font-size: 14px;'>每次分享用户获得奖励的听课券数量</span>
					</div>
				</div>

				<div class="form-group shar_card" style="margin-top:25px;{if $settings['sstatus'] == 0}display:none{/if}">
					<label  class="col-sm-2 control-label">奖励上限/每日</label>
					<div class="col-sm-10">
						<input type="number" name="zsnum" value="{if empty($settings['zsnum'])}1{else}{$settings['zsnum']}{/if}" min="1" class="form-control" style="width:98%"/>
					<span style='color: #cecece;font-size: 14px;'>分享者每天由分享可获得听课券最高上限张数，达到上限后不再获取听课券</span>
					</div>
				</div>

			</div>

			<p  class="list-group-item" style="background-color: #D9EDF7;width:80%;margin:0 auto">支付设置<span style="color:red">若不开启支付，课程与章节价格默认为0.00元</span></p>
			<div active="list-group-item" style="border:1px solid #cecece;width:80%;margin:0 auto">
				<div class="form-group" style="margin-top:25px">
					<label  class="col-sm-2 control-label">是否开启支付功能</label>
					<div class=" col-sm-10" style="padding-left:25px">
						<label class="radio-inline">
							<input type="radio" name="pay_status" value="1" onclick="$('.hkg_payset').show()" title="开启" {if $settings['pay_status'] == '1'}checked{/if} > 开启
						</label>
						<label class="checkbox-inline">
							<input type="radio" name="pay_status" value="0" onclick="$('.hkg_payset').hide()" title="关闭" {if $settings['pay_status'] == '0' || empty($settings['pay_status'])}checked{/if} > 关闭
						</label>
					</div>
					<span style='color: #cecece;font-size: 14px;margin-left: 244px'>开启支付功能后请填写商户号以及支付秘钥</span>
				</div>
				<div class="form-group hkg_payset" style="margin-top:25px;{if $settings['pay_status']==0}display:none{/if}">
					<label  class="col-sm-2 control-label">商户号</label>
					<div class="col-sm-10">
						<input type="text" name="mchid" value="{$settings['mchid']}" class="form-control" style="width:98%"/>
					</div>
				</div>
				<div class="form-group hkg_payset" style="margin-top:25px;{if $settings['pay_status']==0}display:none{/if}">
					<label  class="col-sm-2 control-label">支付秘钥</label>
					<div class="col-sm-10">
						<input type="text" name="pay_secret" value="{$settings['pay_secret']}" class="form-control" style="width:98%"/>
					</div>
				</div>
			</div>

			<p  class="list-group-item" style="background-color: #D9EDF7;width:80%;margin:0 auto">报名咨询设置</p>
			<div active="list-group-item" style="border:1px solid #cecece;width:80%;margin:0 auto">
				<div class="form-group" style="margin-top:25px">
					<label  class="col-sm-2 control-label">咨询电话</label>
					<div class="col-sm-10">
						<input type="text" name="number" value="{$settings['number']}" class="form-control" onkeyup="value=value.replace(/[^\d\-\d]/g,'')" style="width:98%" maxlength=20/>
					</div>
				</div>
			</div>

			<input type="hidden" name="token" value="{$_W['token']}">
			<div style="float: right;margin:10px">
				<input type="submit" name="submit" value="保存设置" class="btn btn-info" >
			</div>
			<div style="clear: both;"></div>
		</div>
		
	</form>
</div>

{template 'common/footer'}